home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source1.lha / source / amiga / CardRes.mod < prev    next >
Encoding:
Text File  |  1995-01-26  |  5.9 KB  |  244 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: CardRes.mod $
  4.   Description: Interface to card.resource
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.6 $
  8.       $Author: fjc $
  9.         $Date: 1995/01/26 02:39:55 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1990-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A Interface Copyright © 1994-1995, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. *************************************************************************)
  21.  
  22. <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
  23. <*$ CaseChk-  IndexChk- LongVars+ NilChk-  *>
  24. <*$ RangeChk- StackChk- TypeChk-  OvflChk- *>
  25.  
  26. MODULE [2] CardRes;
  27.  
  28. IMPORT SYS := SYSTEM, e := Exec, s := Sets;
  29.  
  30. (*
  31. **      $VER: card.h 1.11 (14.12.92)
  32. **
  33. **      card.resource include file
  34. *)
  35.  
  36. CONST
  37.  
  38.   cardResName * = "card.resource";
  39.  
  40. TYPE
  41.  
  42. (* Structures used by the card.resource                         *)
  43.  
  44.   CardHandlePtr * = POINTER TO CardHandle;
  45.   CardHandle  * = RECORD
  46.     node *     : e.Node;
  47.     removed *  : e.InterruptPtr;
  48.     inserted * : e.InterruptPtr;
  49.     status *   : e.InterruptPtr;
  50.     flags *    : s.SET8;
  51.   END;
  52.  
  53.   DeviceTDataPtr * = POINTER TO DeviceTData;
  54.   DeviceTData  * = RECORD
  55.     size *  : e.ULONG;       (* Size in bytes                *)
  56.     speed * : e.ULONG;       (* Speed in nanoseconds         *)
  57.     type *  : SHORTINT;      (* Type of card                 *)
  58.     flags * : s.SET8;        (* Other flags                  *)
  59.   END;
  60.  
  61.   CardMemoryMapPtr * = POINTER TO CardMemoryMap;
  62.   CardMemoryMap  * = RECORD
  63.     commonMemory *    : e.APTR;
  64.     attributeMemory * : e.APTR;
  65.     ioMemory *        : e.APTR;
  66.  
  67. (* Extended for V39 - These are the size of the memory spaces above *)
  68.  
  69.     commonMemSize *    : e.ULONG;
  70.     attributeMemSize * : e.ULONG;
  71.     ioMemSize *        : e.ULONG;
  72.  
  73.   END;
  74.  
  75. CONST
  76.  
  77. (* CardHandle.cah_CardFlags for OwnCard() function              *)
  78.  
  79.   resetRemove * = 0;
  80.   ifAvailable * = 1;
  81.   delayOwnership * = 2;
  82.   postStatus * = 3;
  83.  
  84. (* ReleaseCreditCard() function flags                           *)
  85.  
  86.   removeHandle * = 0;
  87.  
  88. (* ReadStatus() return flags                                    *)
  89.  
  90.   statusbCCDET * = 6;
  91.   statusbBVD1 * = 5;
  92.   statusbSC * = 5;
  93.   statusbBVD2 * = 4;
  94.   statusbDA * = 4;
  95.   statusbWR * = 3;
  96.   statusbBSY * = 2;
  97.   statusbIRQ * = 2;
  98.  
  99. (* CardProgramVoltage() defines *)
  100.  
  101.   voltage0v * = 0;                 (* Set to default; may be the same as 5V *)
  102.   voltage5v * = 1;
  103.   voltage12v * = 2;
  104.  
  105. (* CardMiscControl() defines *)
  106.  
  107.   enableDigAudio * = 1;
  108.   disableWP * = 3;
  109.  
  110. (*
  111.  * New CardMiscControl() bits for V39 card.resource.  Use these bits to set,
  112.  * or clear status change interrupts for BVD1/SC, BVD2/DA, and BSY/IRQ.
  113.  * Write-enable/protect change interrupts are always enabled.  The defaults
  114.  * are unchanged (BVD1/SC is enabled, BVD2/DA is disabled, and BSY/IRQ is enabled).
  115.  *
  116.  * IMPORTANT -- Only set these bits for V39 card.resource or greater (check
  117.  * resource base VERSION)
  118.  *
  119.  *)
  120.  
  121.   intbSetClr * = 7;
  122.   intbBVD1 * = 5;
  123.   intbSC * = 5;
  124.   intbBVD2 * = 4;
  125.   intbDA * = 4;
  126.   intbBSY * = 2;
  127.   intbIRQ * = 2;
  128.  
  129.  
  130. (* CardInterface() defines *)
  131.  
  132.   interfaceAmiga0 * = 0;
  133.  
  134. (*
  135.  * Tuple for Amiga execute-in-place software (e.g., games, or other
  136.  * such software which wants to use execute-in-place software stored
  137.  * on a credit-card, such as a ROM card).
  138.  *
  139.  * See documentatin for IfAmigaXIP().
  140.  *)
  141.  
  142.   cisTplAmigaXIP * = 091H;
  143.  
  144. TYPE
  145.  
  146.   TPAmigaXIPPtr * = POINTER TO TPAmigaXIP;
  147.   TPAmigaXIP  * = RECORD
  148.     code *  : SHORTINT;
  149.     link *  : SHORTINT;
  150.     loc *   : ARRAY 4 OF SHORTINT;
  151.     flags * : s.SET8;
  152.     resrv * : SHORTINT;
  153.   END;
  154.  
  155. CONST
  156.  
  157. (*
  158.  
  159.         ; The XIPFLAGB_AUTORUN bit means that you want the machine
  160.         ; to perform a reset if the execute-in-place card is inserted
  161.         ; after DOS has been started.  The machine will then reset,
  162.         ; and execute your execute-in-place code the next time around.
  163.         ;
  164.         ; NOTE -- this flag may be ignored on some machines, in which
  165.         ; case the user will have to manually reset the machine in the
  166.         ; usual way.
  167.  
  168. *)
  169.  
  170.   autoRun * = 0;
  171.  
  172. (**-- Library Base variable --------------------------------------------*)
  173.  
  174. (*
  175.  *  You have to put a pointer to the card.resource here to use the cia
  176.  *  procedures:
  177.  *)
  178.  
  179. VAR base* : e.APTR;
  180.  
  181. (**-- Library Functions ------------------------------------------------*)
  182.  
  183. (*
  184. **      $VER: cardres_protos.h 1.2 (8.9.92)
  185. *)
  186.  
  187. PROCEDURE OwnCard* [base,-6]
  188.   ( handle [9] : CardHandlePtr )
  189.   : CardHandlePtr;
  190. PROCEDURE ReleaseCard* [base,-12]
  191.   ( handle [9] : CardHandlePtr;
  192.     flags  [0] : e.ULONG );
  193. PROCEDURE GetCardMap* [base,-18] ()
  194.   : CardMemoryMapPtr;
  195. PROCEDURE BeginCardAccess* [base,-24]
  196.   ( handle [9] : CardHandlePtr )
  197.   : BOOLEAN;
  198. PROCEDURE EndCardAccess* [base,-30]
  199.   ( handle [9] : CardHandlePtr )
  200.   : BOOLEAN;
  201. PROCEDURE ReadCardStatus* [base,-36] ()
  202.   : e.UBYTE;
  203. PROCEDURE CardResetRemove* [base,-42]
  204.   ( handle [9] : CardHandlePtr;
  205.     flag   [0] : e.ULONG )
  206.   : BOOLEAN;
  207. PROCEDURE CardMiscControl* [base,-48]
  208.   ( handle      [9] : CardHandlePtr;
  209.     controlBits [1] : s.SET8 )
  210.   : s.SET8;
  211. PROCEDURE CardAccessSpeed* [base,-54]
  212.   ( handle      [9] : CardHandlePtr;
  213.     nanoseconds [0] : e.ULONG )
  214.   : e.ULONG;
  215. PROCEDURE CardProgramVoltage* [base,-60]
  216.   ( handle  [9] : CardHandlePtr;
  217.     voltage [0] : e.ULONG )
  218.   : LONGINT;
  219. PROCEDURE CardResetCard* [base,-66]
  220.   ( handle [9] : CardHandlePtr )
  221.   : BOOLEAN;
  222. PROCEDURE CopyTuple* [base,-72]
  223.   ( handle    [9] : CardHandlePtr;
  224.     buffer    [8] : ARRAY OF SYS.BYTE;
  225.     tuplecode [1] : e.ULONG;
  226.     size      [0] : e.ULONG )
  227.   : BOOLEAN;
  228. PROCEDURE DeviceTuple* [base,-78]
  229.   ( tupleData [8] : e.APTR;
  230.     storage   [9] : DeviceTDataPtr )
  231.   : e.ULONG;
  232. PROCEDURE IfAmigaXIP* [base,-84]
  233.   ( handle [10] : CardHandlePtr )
  234.   : e.ResidentPtr;
  235. PROCEDURE CardForceChange* [base,-90] ()
  236.   : BOOLEAN;
  237. PROCEDURE CardChangeCount* [base,-96] ()
  238.   : e.ULONG;
  239. PROCEDURE CardInterface* [base,-102] ()
  240.   : e.ULONG;
  241.  
  242. BEGIN base := NIL
  243. END CardRes.
  244.